package com.hangxin.commons.dao;

import java.util.List;
import java.util.Map;

import org.springframework.jdbc.core.RowMapper;

import com.hangxin.commons.util.PageModel;

/**
 * @author
 * 
 *         dao父接口
 * 
 */
public interface BasicDao {

	public int save(String sql, Object[] params);

	public int edit(String sql, Object[] params);

	public int delete(String sql);

	public int delete(String sql, Object[] params);

	public <T> T find(String sql, Object[] params, RowMapper<T> rm);

	public <T> List<T> findAll(String sql, Object[] params, RowMapper<T> rm);

	public <T> List<T> findAll(String sql, Class<T> classtype);

	public int findByCount(String sql);

	public int findByCount(String sql, Object[] params);

	public int findByMaxId(String sql);

	public int findByMaxId(String sql, Object[] params);

	public String getSn(String sql);

	public <T> T findName(String sql, Class<T> type);

	public <T> T findName(String sql, Object[] params, Class<T> type);

	public <T> T findMap(String sql, Object[] params);
	
	public <T> T findByMap(String sql, Object[] params);
	
	public PageModel<Map<String, Object>> listByObject(String sqlcount,
			String sql, PageModel<Map<String, Object>> pageModel,
			Object[] paramscount, Object[] params);

	public PageModel<Map<String, Object>> listByObject(String sqlcount,
			String sql, PageModel<Map<String, Object>> pageModel);

	public <T> PageModel<T> listByMapper(String sqlcount, String sql,
			PageModel<T> pageModel, Object[] paramscount, Object[] params,
			RowMapper<T> rowMapper);

	public int[] batchsql(String sql, String params);
	
	public void proCallable(String statement);
}
